<template>
<div>
  <div class="brick-item brick-item-m brick-item-m-2" :style="{ 'width': width }">
    <div class="figure figure-img">
      <img :src="imgSrc" alt="">
    </div>
    <h3 class="title">{{ title }}</h3>
    <p class="desc">{{ desc }}</p>
    <p class="price">
      <span class="num">{{ price }}</span>元<span>起</span>
      <template v-if="delPrice">
        <del><span class="num">{{ delPrice }}</span>元</del>
      </template>
    </p>
  </div>
</div>
</template>

<script>
export default {
  props: {
    width: {
      type: String,
      default: '234px'
    },
    imgSrc: {
      type: String,
      required: true
    },
    title: {
      type: String,
      required: true
    },
    desc: {
      type: String,
      required: true
    },
    price: {
      type: Number,
      required: true
    },
    delPrice: {
      typeof: Number
    }
  }
}
</script>

<style scoped>
.brick-item-m {
  height: 246px;
  padding: 34px 0 20px;
}

.brick-item-m-2 {
  height: 260px;
  padding: 20px 0;
}

.brick-item .figure-img img {
  width: 160px;
  height: 160px;
}

.brick-item-m .figure-img {
  width: 150px;
  height: 150px;
  margin: 0 auto 18px;
}

.brick-item-m-2 .figure-img,
.brick-item-m-2 .figure-img img {
  width: 160px;
  height: 160px;
}

.brick-item-m .desc,
.brick-item-m .title {
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.brick-item-m .title {
  margin: 0 10px;
  font-size: 14px;
  font-weight: 400;
  color: #333;
}

.brick-item-m-2 .title {
  margin: 0 10px 2px;
}

.brick-item-m .desc {
  margin: 0 10px 10px;
  height: 18px;
  font-size: 12px;
  color: #b0b0b0;
}

.brick-item-m .price {
  margin: 0 10px 10px;
  text-align: center;
  color: #ff6700;
  font-size: 14px;
}

.brick-item-m-2 .price {
  margin: 0 10px 14px;
}
</style>
